package com.javaProject.dto;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class R {
    //状态码 0-成功 -1-失败 400001-权限不足 500001系统异常
    private int code;
    //
    private boolean success;
    private String msg;
    private Object data;

    public static R ok(){
        R r = new R();
        r.code = 0;
        r.success = true;
        r.msg = "成功";
        return r;
    }

    public static R fail(){
        R r = new R();
        r.code = -1;
        r.success = false;
        r.msg = "失败";

        return r;
    }


}
